<?php
/**
 * @OA\SecurityScheme(
 *     type="http",
 *     securityScheme="basicAuth",
 *     name="Authorization",
 *     scheme="basic"
 * )
 */
/**
 * @OA\Info(title="openAuth_leo开源企业系统/权限管理框架", version="1.0.0")
 * @OA\Schemes(format="http")
 *
 *
 * @user: leo
 * @date: 2021/5/18
 * @createTime: 11:08
 * @company: 迈酷网络科技 http://www.maicooit.com
 */




declare (strict_types = 1);
/**
 * @user: leo
 * @date: 2021/5/17
 * @createTime: 14:37
 * @company: 迈酷网络科技 http://www.maicooit.com
 */
namespace app\admin\controller;

use app\BaseController;
use OpenApi\Generator;

class Index extends BaseController
{
    /**
     * @OA\Get(
     *   tags={"Swagger接口文档数据生成"},
     *   path="/admin/swg",
     *   summary="该接口主要用于生成接口文档",
     *   @OA\Response(
     *     response="default",
     *     description="an ""unexpected"" error"
     *   )
     * )
     */
    public function Swagger(){
        $dir = __DIR__;
        $openapi= Generator::scan([$dir]);
        $res = $openapi->saveAs(__DIR__.'/../../../public/Swagger/api.json','auto');
        return json($res);
    }
}
